var gulp = require('gulp');
var jshint = require('gulp-jshint');
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
var header = require('gulp-header');
var merge = require('gulp-merge');

var pkg = require('./package.json');

var banner = '/* Maxthon-Session-Manager created by NoAnyLove (www.noanylove.com) */ \n';

gulp.task('jshint', function () {
    gulp.src('src/*.js')
      .pipe(jshint({laxbreak:true, evil:true}))
      .pipe(jshint.reporter('default'));
});

gulp.task('minify', function () {
    gulp.src('src/*.js')
      .pipe(uglify({preserveComments: 'some'}))
      .pipe(concat('all.min.js'))
      .pipe(header(banner))
      .pipe(gulp.dest('build'));
});

gulp.task('default', ['jshint', 'minify']);